/*******************************************************************************
 * Copyright 2009-2021 Amazon Services. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 *
 * You may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 
 * specific language governing permissions and limitations under the License.
 *******************************************************************************
 * Automated Shipping Settings
 * API Version: 2013-09-01
 * Library Version: 2021-08-20
 * Generated: Fri Aug 20 16:27:18 UTC 2021
 */
package com.amazonservices.mws.orders._2013_09_01.model;

import com.amazonservices.mws.client.*;

/**
 * AutomatedShippingSettings complex type.
 *
 * XML schema:
 *
 * <pre>
 * &lt;complexType name="AutomatedShippingSettings"&gt;
 *    &lt;complexContent&gt;
 *       &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
 *          &lt;sequence&gt;
 *             &lt;element name="hasAutomatedShippingSettings" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/&gt;
 *             &lt;element name="automatedCarrierName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *             &lt;element name="automatedShipMethodName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
 *          &lt;/sequence&gt;
 *       &lt;/restriction&gt;
 *    &lt;/complexContent&gt;
 * &lt;/complexType&gt;
 * </pre>
 */
public class AutomatedShippingSettings extends AbstractMwsObject {

    private Boolean hasAutomatedShippingSettings;

    private String automatedCarrierName;

    private String automatedShipMethodName;

    /**
     * Check the value of hasAutomatedShippingSettings.
     *
     * @return true if hasAutomatedShippingSettings is set to true.
     */
    public boolean isHasAutomatedShippingSettings() {
        return hasAutomatedShippingSettings!=null && hasAutomatedShippingSettings.booleanValue();
    }

    /**
     * Get the value of hasAutomatedShippingSettings.
     *
     * @return The value of hasAutomatedShippingSettings.
     */
    public Boolean getHasAutomatedShippingSettings() {
        return hasAutomatedShippingSettings;
    }

    /**
     * Set the value of hasAutomatedShippingSettings.
     *
     * @param hasAutomatedShippingSettings
     *            The new value to set.
     */
    public void setHasAutomatedShippingSettings(Boolean hasAutomatedShippingSettings) {
        this.hasAutomatedShippingSettings = hasAutomatedShippingSettings;
    }

    /**
     * Check to see if hasAutomatedShippingSettings is set.
     *
     * @return true if hasAutomatedShippingSettings is set.
     */
    public boolean isSetHasAutomatedShippingSettings() {
        return hasAutomatedShippingSettings != null;
    }

    /**
     * Set the value of hasAutomatedShippingSettings, return this.
     *
     * @param hasAutomatedShippingSettings
     *             The new value to set.
     *
     * @return This instance.
     */
    public AutomatedShippingSettings withHasAutomatedShippingSettings(Boolean hasAutomatedShippingSettings) {
        this.hasAutomatedShippingSettings = hasAutomatedShippingSettings;
        return this;
    }

    /**
     * Get the value of automatedCarrierName.
     *
     * @return The value of automatedCarrierName.
     */
    public String getAutomatedCarrierName() {
        return automatedCarrierName;
    }

    /**
     * Set the value of automatedCarrierName.
     *
     * @param automatedCarrierName
     *            The new value to set.
     */
    public void setAutomatedCarrierName(String automatedCarrierName) {
        this.automatedCarrierName = automatedCarrierName;
    }

    /**
     * Check to see if automatedCarrierName is set.
     *
     * @return true if automatedCarrierName is set.
     */
    public boolean isSetAutomatedCarrierName() {
        return automatedCarrierName != null;
    }

    /**
     * Set the value of automatedCarrierName, return this.
     *
     * @param automatedCarrierName
     *             The new value to set.
     *
     * @return This instance.
     */
    public AutomatedShippingSettings withAutomatedCarrierName(String automatedCarrierName) {
        this.automatedCarrierName = automatedCarrierName;
        return this;
    }

    /**
     * Get the value of automatedShipMethodName.
     *
     * @return The value of automatedShipMethodName.
     */
    public String getAutomatedShipMethodName() {
        return automatedShipMethodName;
    }

    /**
     * Set the value of automatedShipMethodName.
     *
     * @param automatedShipMethodName
     *            The new value to set.
     */
    public void setAutomatedShipMethodName(String automatedShipMethodName) {
        this.automatedShipMethodName = automatedShipMethodName;
    }

    /**
     * Check to see if automatedShipMethodName is set.
     *
     * @return true if automatedShipMethodName is set.
     */
    public boolean isSetAutomatedShipMethodName() {
        return automatedShipMethodName != null;
    }

    /**
     * Set the value of automatedShipMethodName, return this.
     *
     * @param automatedShipMethodName
     *             The new value to set.
     *
     * @return This instance.
     */
    public AutomatedShippingSettings withAutomatedShipMethodName(String automatedShipMethodName) {
        this.automatedShipMethodName = automatedShipMethodName;
        return this;
    }

    /**
     * Read members from a MwsReader.
     *
     * @param r
     *      The reader to read from.
     */
    @Override
    public void readFragmentFrom(MwsReader r) {
        hasAutomatedShippingSettings = r.read("hasAutomatedShippingSettings", Boolean.class);
        automatedCarrierName = r.read("automatedCarrierName", String.class);
        automatedShipMethodName = r.read("automatedShipMethodName", String.class);
    }

    /**
     * Write members to a MwsWriter.
     *
     * @param w
     *      The writer to write to.
     */
    @Override
    public void writeFragmentTo(MwsWriter w) {
        w.write("hasAutomatedShippingSettings", hasAutomatedShippingSettings);
        w.write("automatedCarrierName", automatedCarrierName);
        w.write("automatedShipMethodName", automatedShipMethodName);
    }

    /**
     * Write tag, xmlns and members to a MwsWriter.
     *
     * @param w
     *         The Writer to write to.
     */
    @Override
    public void writeTo(MwsWriter w) {
        w.write("https://mws.amazonservices.com/Orders/2013-09-01", "AutomatedShippingSettings",this);
    }


    /** Default constructor. */
    public AutomatedShippingSettings() {
        super();
    }

}
